package com.atxwq.shop.common.exception;

import com.atxwq.shop.model.vo.common.ResultCodeEnum;
import lombok.Data;

/**
 * @Description 自定义异常类
 * @Date 2025/5/7 20:40
 * @Created by 12336
 */

@Data
public class GlobalException extends RuntimeException{
    private Integer code;
    private String message;
    private ResultCodeEnum resultCodeEnum;

    public GlobalException(ResultCodeEnum resultCodeEnum) {
        this.resultCodeEnum = resultCodeEnum;
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
